import Vue from 'vue';
import App from './App';
import router from './router';
import store from './store'
import Vant from 'vant'
import 'lib-flexible/flexible'
import {
  Popup,
  Picker,
  Toast,
  PullRefresh,
  List,
  Overlay,
  Dialog
} from 'vant';
import 'vant/lib/index.css';
import Promise from 'es6-promise'
import Api from '@/api/api'
import HeadTitle from '@/components/HeadTitle'
import VueCanvasPoster from 'vue-canvas-poster'
import {imageUrl} from '@/utils/filters'


Vue.config.productionTip = false;
import VueClipboard from 'vue-clipboard2'
VueClipboard.config.autoSetContainer = true
Vue.use(VueClipboard)
Vue.use(Vant)
Vue.use(Picker)
Vue.use(Popup)
Vue.use(Toast)
Vue.use(PullRefresh)
Vue.use(List)
Vue.use(Overlay)
Vue.use(Dialog)
Vue.component('HeadTitle',HeadTitle)
Vue.use(VueCanvasPoster)
Vue.filter('imageUrl',imageUrl)
Vue.prototype.$Api = Api;
Vue.prototype.$toast = Toast;
Vue.prototype.$dialog = Dialog;
Vue.prototype.replaceSpecialChar = (detail)=>{
  var content = detail.replace(/<img[^>]*>/gi, function(match, capture) {
    var match = match.replace(/(style="(.*?)")|(width="(.*?)")|(height="(.*?)")/ig,'');
    return match;
  });
  return content;
}
Vue.prototype.$imgUrl = "https://xueyizhi.oss-cn-shenzhen.aliyuncs.com/";


  /* eslint-disable no-new */
  new Vue({
    el: '#app',
    router,
    store,
    components: {
      App
    },
    template: '<App/>'
  })
